﻿<UserControl x:Class="AddressBox.AddressBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" MinHeight="45" MaxHeight="45" MinWidth="250" 
             HorizontalAlignment="Stretch" VerticalAlignment="Top"
             d:DesignHeight="43" d:DesignWidth="250"
             Background="Transparent" >

    <!--<KeyBinding Command="{Binding SaveCommand}"
            Gesture="Ctrl+Shift+S" />-->
    <!--<KeyBinding Modifiers="Ctrl+Shift" Key="S" Command="{Binding SaveCommand}" />-->
    
    <Grid Name="grdLayout" >
        <Grid.Resources>
            <Style x:Key="NavigationButtonStyle" TargetType="Button" >
                <Setter Property="Width" Value="30" />
                <Setter Property="Margin" Value="2,0,2,0" />
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid Name="grdPathSearch" Grid.ColumnSpan="4" >
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition Width="100" />
            </Grid.ColumnDefinitions>

            <Grid Name="grdPath" Grid.ColumnSpan="3" Margin="0,0,3,0" Height="23">
                <TextBox Name="txtBasePath" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="20" 
                         ToolTipService.ShowOnDisabled="True" ToolTipService.HasDropShadow="True" ToolTipService.ShowDuration="100"
                         VerticalContentAlignment="Center" Panel.ZIndex="1" TextChanged="txtBasePath_TextChanged" 
                         PreviewKeyDown="Suggestion_Navigation"
                         KeyDown="Suggestion_Navigation" >
                    <TextBox.ToolTip>
                        <Border CornerRadius="2" BorderThickness="1" Margin="3">
                            <StackPanel Margin="3">
                                <TextBlock Name="txtbTooltipTitle" FontWeight="Bold" Text="Info" />
                                <TextBlock Name="txtbTooltipValue" />
                            </StackPanel>
                        </Border>
                    </TextBox.ToolTip>
                </TextBox>
                <ComboBox Name="cmbPathSuggestion" Grid.Row="0" Height="{Binding ElementName=txtPath, Path=Height}"
                          SelectedValuePath="Id" DisplayMemberPath="Id" ItemsSource="{Binding AllPathSuggestions}"
                          HorizontalAlignment="{Binding ElementName=txtPath, Path=HorizontalAlignment}" 
                          VerticalAlignment="{Binding ElementName=txtPath, Path=VerticalAlignment}" Panel.ZIndex="0" 
                          PreviewKeyDown="cmbPathSuggestion_PreviewKeyDown" />
            </Grid>
            <Button Name="btnBrowsePath" Grid.Column="4" Height="23" Margin="3,0,0,0" 
                    Content="Browse.." HorizontalAlignment="Stretch" 
                    Click="btnBrowsePath_Click" />
        </Grid>
        <StackPanel Name="stkNavigation" Grid.Row="1" Grid.ColumnSpan="4" Orientation="Horizontal" >
            <!--<ToggleButton Name="btnFetchDirUp" Style="{StaticResource NavigationButtonStyle}" Content="Up" 
                          DataContext="{StaticResource InteractionsVM}" IsChecked="{Binding IsClickedUp, Mode=TwoWay}" />
            <ToggleButton Name="btnFetchDirDown" Style="{StaticResource NavigationButtonStyle}" Content="Down" 
                          DataContext="{StaticResource InteractionsVM}" IsChecked="{Binding IsClickedDown, Mode=TwoWay}" />
            <ToggleButton Name="btnFetchDirPrev" Style="{StaticResource NavigationButtonStyle}" Content="Prev" 
                          DataContext="{StaticResource InteractionsVM}" IsChecked="{Binding IsClickedPrev, Mode=TwoWay}" />
            <ToggleButton Name="btnFetchDirNext" Style="{StaticResource NavigationButtonStyle}" Content="Next" 
                          DataContext="{StaticResource InteractionsVM}" IsChecked="{Binding IsClickedNext, Mode=TwoWay}" />-->
            <Button Name="btnFetchDirUp" Style="{StaticResource NavigationButtonStyle}" Content="Up" 
                    Click="btnFetchDirectory_Click" />
            <Button Name="btnFetchDirDown" Style="{StaticResource NavigationButtonStyle}" Content="Down" 
                    Click="btnFetchDirectory_Click" />
            <Button Name="btnFetchDirPrev" Style="{StaticResource NavigationButtonStyle}" Content="Prev" 
                    Click="btnFetchDirectory_Click" />
            <Button Name="btnFetchDirNext" Style="{StaticResource NavigationButtonStyle}" Content="Next" 
                    Click="btnFetchDirectory_Click" />
        </StackPanel>
    </Grid>
</UserControl>
